﻿import {JsonObject} from "./jsonobject";
import {QuestionFactory} from "./questionfactory";
import {QuestionCheckboxBase} from "./question_baseselect";

/**
 * A Model for a radiogroup question.
 */
export class QuestionRadiogroupModel extends QuestionCheckboxBase {
    constructor(public name: string) {
        super(name);
    }
    public getType(): string {
        return "radiogroup";
    }
    supportGoNextPageAutomatic() { return true; }
}

JsonObject.metaData.addClass("radiogroup", [], function () { return new QuestionRadiogroupModel(""); }, "checkboxbase");

QuestionFactory.Instance.registerQuestion("radiogroup", (name) => { var q = new QuestionRadiogroupModel(name); q.choices = QuestionFactory.DefaultChoices; return q;});
